<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"></c:set>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>55社区田园</title>
    <meta name="description" content="">
    <meta name="keywords" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <meta name="renderer" content="webkit">
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <link rel="icon" type="image/png" href="/theme/default/images/favicon.png">
    <jsp:include page="common.jsp"></jsp:include>
    <script>
        $(function () {
            var elm = $('#shortbar');
            var startPos = $(elm).offset().top;
            $.event.add(window, "scroll", function () {
                var p = $(window).scrollTop();
                if (p > startPos) {
                    elm.addClass('sortbar-fixed');
                } else {
                    elm.removeClass('sortbar-fixed');
                }
            });
        });

    </script>
</head>
<body>
<!--图片轮换-->
<div class="am-slider am-slider-default" data-am-flexslider id="demo-slider-0" style="position: relative;">
    <header data-am-widget="header" class="am-header am-header-default tm-head" id="shortbar" >
        <div class="am-header-left am-header-nav">
            <a href="city.html" class="">
                <img src="${ctx}/static/images/city.png" />
                <p style="font-size: 12px; margin-top: -35px;">南昌</p>
            </a>
        </div>
        <h1 class="am-header-title1">
            <div class="search-box">
                <input type="text" name="title" class="index-search" placeholder="寻找你喜欢的商品......" />
                <input type="submit" value="" class="search-icon" />
            </div>
        </h1>
        <div class="am-header-right am-header-nav">

            <a href="" class="">
                <img src="${ctx}/static/images/sao.png" />
                <p style="font-size: 12px; margin-top: -35px;">扫一扫</p>
            </a>
        </div>
    </header>
    <ul class="am-slides">
        <li><img src="${ctx}/static/images/banner1.png" /></li>
        <li><img src="${ctx}/static/images/banner1.png" /></li>
    </ul>
</div>
<!--导航-->
<ul class="sq-nav"  >
    <li>
        <div class="am-gallery-item">
            <a href="${ctx}/goods/newproduct.do" class="">
                <img src="${ctx}/static/images/icon.png" />
                <p>新品</p>
            </a>
        </div>
    </li>
    <li>
        <div class="am-gallery-item">
            <a href="${ctx}/goods/specialprice.do" class="">
                <img src="${ctx}/static/images/icon1.png" />
                <p>特价</p>
            </a>
        </div>
    </li>
    <li>
        <div class="am-gallery-item">
            <a href="${ctx}/goods/goods_reserve.do" class="">
                <img src="${ctx}/static/images/icon2.png" />
                <p>预定</p>
            </a>
        </div>
    </li>
    <li>
        <div class="am-gallery-item">
            <a href="${ctx}/integral.jsp" class="">
                <img src="${ctx}/static/images/icon3.png" />
                <p>积分</p>
            </a>
        </div>
    </li>
    <li>
        <div class="am-gallery-item">
            <a href="allchips.html" class="">
                <img src="${ctx}/static/images/icon4.png" />
                <p>众筹</p>
            </a>
        </div>
    </li>
    <li>
        <div class="am-gallery-item">
            <a href="whitebar.html" class="">
                <img src="${ctx}/static/images/icon5.png" />
                <p>白条</p>
            </a>
        </div>
    </li>
    <li>
        <div class="am-gallery-item">
            <a href="${ctx}/news/list.do" class="">
                <img src="${ctx}/static/images/icon6.png" />
                <p>头条</p>
            </a>
        </div>
    </li>
    <li>
        <div class="am-gallery-item">
            <a href="${ctx}/goods/type.do" class="">
                <img src="${ctx}/static/images/icon7.png" />
                <p>分类</p>
            </a>
        </div>
    </li>
</ul>
<!--限时秒杀 -->
<div class="sq-title">
    <i class="am-icon-volume-up"></i>
    <div class="fnTimeCountDown" data-end="2018/07/08 18:45:13">
        限时秒杀：距开抢
        <span class="hour">00</span>
        <strong>:</strong>
        <span class="mini">00</span>
        <strong>:</strong>
        <span class="sec">00</span>
    </div>
    <script type="text/javascript">
        /*$(".fnTimeCountDown").fnTimeCountDown("2018/07/08 18:45:13");*/
    </script>
</div>
<ul data-am-widget="gallery" class="a am-gallery pro-list am-avg-sm-3 am-avg-md-3 am-avg-lg-4 am-gallery-default"  >

</ul>
<!-- 特色专区-->
<div class="sq-title">
    <img src="${ctx}/static/images/ts.png" width="24"/>
    特色专区
</div>
<ul data-am-widget="gallery" class="b am-gallery pro-list am-avg-sm-3 am-avg-md-3 am-avg-lg-4 am-gallery-default"  >

</ul>
<!-- 精品专区-->
<div class="sq-title">
    <img src="${ctx}/static/images/jp.png" width="24"/>
    精品专区
</div>
<ul data-am-widget="gallery" class="c am-gallery pro-list am-avg-sm-3 am-avg-md-3 am-avg-lg-4 am-gallery-default"  >

</ul>
<!-- 便民-->
<div class="sq-title">
    <img src="${ctx}/static/images/bm.png" width="24"/>
    便民服务
</div>
<ul class="yule">
</ul>
<!--底部-->
<jsp:include page="footer.jsp"></jsp:include>


<script>
    function loadgoods(){
        var a='<li><div class="am-gallery-item"><a href="{{url}}" class=""><img src="{{img}}" /><h3 class="am-gallery-title">{{text}}</h3><div class="am-gallery-desc">￥{{price}}</div></a></div></li>';
        $.post("${ctx}/goods/goodsindex.do",{},function (data) {
            for (var i = 0; i < data.length ; i++) {
                var con=a.replace("{{url}}","${ctx}/goods/detail.do?name="+data[i].goods_name);
                con=con.replace("{{img}}","${ctx}/static/"+data[i].goods_img);
                con=con.replace("{{text}}",data[i].goods_name);
                con=con.replace("{{price}}",data[i].goods_price);
                $(".a").append(con);
                $(".b").append(con);
                $(".c").append(con);
            }
        },"json")
    }
    function loadnews(){
        var a='<li><a href="{{url}}"><img src="{{img}}"><div style="width: 70%; float: left;"><h3 class="title">{{title}}</h3><p class="intro">{{text}}</p></div></a></li>';
        $.post("${ctx}/news/index_list.do",{},function (data) {
            for (var i = 0; i < data.length ; i++) {
                var con=a.replace("{{url}}","#");
                con=con.replace("{{img}}","${ctx}/static/"+data[i].news_img);
                con=con.replace("{{title}}",data[i].news_title);
                con=con.replace("{{text}}",data[i].news_content);
                $(".yule").append(con);
            }
        },"json")
    }
    $(function () {
        loadgoods();
        loadnews();
    })
</script>


</body>
</html>
